package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	gpb "gitee.com/cloudapex/protos/sys_know/pb"
	"google.golang.org/grpc"
)

var Sys sys

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_KB_SYS, func(c *grpc.ClientConn) {
		Sys.cli = gpb.NewSysKnowLeClient(c)
	})
}

type sys struct {
	cli gpb.SysKnowLeClient
}

func (this *sys) GetList(ctx context.Context, in *gpb.SysKnowListReq) (*gpb.SysKnowListRes, error) {
	return this.cli.GetSysKnowList(ctx, in)
}

func (this *sys) Add(ctx context.Context, in *gpb.SysKnowReq) (*gpb.SysKnowRes, error) {
	return this.cli.AddSysKnow(ctx, in)
}

func (this *sys) Edit(ctx context.Context, in *gpb.SysKnowReq) (*gpb.SysKnowRes, error) {
	return this.cli.EditSysKnow(ctx, in)
}

func (this *sys) Del(ctx context.Context, in *gpb.SysKnowReq) (*gpb.SysKnowRes, error) {
	return this.cli.DelSysKnow(ctx, in)
}

func (this *sys) Info(ctx context.Context, in *gpb.SysKnowReq) (*gpb.SysKnowRes, error) {
	return this.cli.GetSysKnow(ctx, in)
}
